package com.example.testhiber.initPackage.business.test;


import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.example.testhiber.initPackage.business.Dictionaries.Period;
import com.example.testhiber.initPackage.business.Dictionaries.TrackType;
import com.example.testhiber.initPackage.business.utils.JsoupUtils;
import com.example.testhiber.initPackage.business.utils.StringKit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class test3 {
    private static final Logger logger = LoggerFactory.getLogger(test3.class);
    private static final String PATH="/test/";


    public static void main(String[] args) {
        String arr[] = new String []{"13812409809","13381176901","15252889988","13852800682","15951987418","18082120036","17805246422"};

        String res = JsoupUtils.getTxl("13381176901");
        String res2 = JsoupUtils.getTxlFx("13381176901");
//        String res = JsoupUtils.getSjzh("a5de142b1690bc5df986b91e67ed91431331d20b","1","99");
//        String res = JsoupUtils.tjWifiCx("a5de142b1690bc5df986b91e67ed91431331d20b","1","99");
        System.out.println("res："+res);
        System.out.println("res2："+res2);
        JSONObject txlJson = JSONObject.parseObject(res);
        JSONObject txlfxJson = JSONObject.parseObject(res2);
        String childRes = StringKit.toString(txlJson.get("children"));
        String child2Res = StringKit.toString(txlfxJson.get("children"));
        if(!"".equals(StringKit.toString(childRes))){
            JSONArray childArr = JSONArray.parseArray(childRes);
            System.out.println("childArr:"+childArr);
            for(Object o:childArr){
                JSONObject phoneObj = JSONObject.parseObject(StringKit.toString(o));
                String phone = StringKit.toString(phoneObj.get("phone"));
                String label = StringKit.toString(phoneObj.get("label"));
                System.out.println("phone："+phone);
                System.out.println("label："+label);
            }
        }
        if(!"".equals(StringKit.toString(child2Res))){
            JSONArray child2Arr = JSONArray.parseArray(child2Res);
            System.out.println("child2Arr:"+child2Arr);
            for(Object o:child2Arr){
                JSONObject phoneObj = JSONObject.parseObject(StringKit.toString(o));
                String phone = StringKit.toString(phoneObj.get("phone"));
                String label = StringKit.toString(phoneObj.get("label"));
                System.out.println("phone："+phone);
                System.out.println("label："+label);
            }
        }

    }

}